package com.up.upzl.biz.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.up.upzl.base.domain.BaseDomain;

import lombok.Getter;
import lombok.Setter;

/**
 * 新闻资讯和优铺社区的模块管理
 * 
 * @author joker
 *
 */
@Getter
@Setter
@Entity
public class ModuleArticle extends BaseDomain {

	private static final long serialVersionUID = -5390682813018700902L;

	/**
	 * 标题
	 */
	@Column(length = 64)
	private String title;

	/**
	 * 图片
	 */
	@Column(length = 200)
	private String coverUrl;

	/**
	 * 所属模块ID
	 */

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "module_id")
	private Module module;

	/**
	 * 文章ID
	 */
	@Column(name = "article_id", insertable = false, updatable = false)
	private Long articleId;

	/**
	 * 新闻ID
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "article_id")
	private Article article;

	/**
	 * 链接路径
	 */
	@Column(length = 64)
	private String url;

	/**
	 * 简单描述
	 */
	@Column(length = 150)
	private String description;

	/**
	 * 点击量
	 */
	private Integer clickNumber;

	/**
	 * 排序
	 */
	private Integer sort;

}
